package com.itheima.api;

import java.util.Arrays;

public class Demo12 {
    public static void main(String[] args) {
        int[] arr={97,18,27,63,54,38};
       //求 38在数组中的位置
      Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
      /*  for (int i = 0; i < arr.length; i++) {
            if(arr[i]==38){
                System.out.println(i);
            }
        }*/
        System.out.println(Arrays.binarySearch(arr, 54));
        System.out.println(Arrays.binarySearch(arr, 38));
        System.out.println(Arrays.binarySearch(arr, 100));//-6-1
        System.out.println(Arrays.binarySearch(arr, 30));//-6-1
        System.out.println(Arrays.binarySearch(arr, 0));//-6-1
        // -插入点-1
        //想对数组内部的数据进行重新排序





    }
}
